guests = ['luoyunfu','zhouwengyu','luoyuanming','wangxue','luofuxuan']
print("A list of my invitations to dinner :")
print(guests)
print("\n"+guests[-1].title()+" could not keep the appointment.\n")
guests[-1] = "xiaojiejie"
print("A list of my invitations to dinner :")
print(guests)
guests.insert(0,"xiaoming")
guests.insert(3,"xiaohong")  #insert(添加在列表的哪个位置,"元素")可以添加在任何位置
guests.append("tanyiyu")     # append()是将元素添加到列表末尾
print("A list of my invitations to dinner :")
print(guests)
